package com.datastructure.test;

import java.util.*;
public class Main{
    static long temp = 1;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int data = sc.nextInt();
        String s = sc.nextLine();
        boolean b = sc.hasNext();
        long result=0;
        for(int i=1;i<=data;i++){
            temp=1;
            result+=getResult(i);
        }
        System.out.print(result);
    }
    public static long getResult(int data){
        while(data!=0){
            temp*=data;
            data--;
        }
        return temp;
    }



}
